<!DOCTYPE html>
<html>
<head th:include="_header_include::frag(~{::title},~{::style},~{})" >
    <title>我的客户</title>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="css/element-ui.css">
    <link rel="stylesheet" href="css/base.css">
    <style>
        /*页面不可复制*/
        html,body{
            -moz-user-select:none; /* Firefox私有属性 */
            -webkit-user-select:none; /* WebKit内核私有属性 */
            -ms-user-select:none; /* IE私有属性(IE10及以后) */
            -khtml-user-select:none; /* KHTML内核私有属性 */
            -o-user-select:none; /* Opera私有属性 */
            user-select:none; /* CSS3属性 */
        }
        .el-tooltip__popper{max-width: 500px}
        .widthauto1 .el-form-item__label {
            width: auto!important;
            color: #606266;
        }
        .el-table .warning-row .cell,.el-table .warning-row .cell span{
            font-weight: bold;
        }
    </style>
</head>
<body>
<div id="myCustom" class="myCustom mainPadding" style="display: none;">
    <!-- <el-breadcrumb separator="/" class="elBreadcrumb marginB20" v-if="isElBreadcrumb">
        <el-breadcrumb-item>Home</el-breadcrumb-item>
        <el-breadcrumb-item>电销管理</el-breadcrumb-item>
        <el-breadcrumb-item>我的客户</el-breadcrumb-item>
    </el-breadcrumb> -->
    <table-uniontabtemplate :param="dataUrlParamHJ" v-if="isElBreadcrumb"></table-uniontabtemplate>
    <table-uniontabtemplate :param="dataUrlParam" v-else></table-uniontabtemplate>
    <el-row class="marginB20">
        <el-button type="primary" @click="dialogChooseList = true"><i class="el-icon-menu"></i>选择列</el-button>
        <shiro:hasPermission name="myCustomerInfo:apply">
            <el-button type="success" @click="openFormInfo">重单申请</el-button>
        </shiro:hasPermission>
        <!-- <shiro:hasPermission name="myCustomerInfo:releaseClue">
            <el-button type="danger" @click="openeleaseForm">释放资源</el-button>
        </shiro:hasPermission> -->

        <!-- <el-button type="warning">查询重复</el-button> -->
        <shiro:hasPermission name="myCustomerInfo:add">
            <el-button type="warning" @click="createClueData" v-if="isShowCreate">新建客户资源</a></el-button>
        </shiro:hasPermission>
    </el-row>
    <div class="mainSearchBg">
        <div class="mainSearchFormBox">
            <el-form :inline="true" class="demo-form-inline mainSearchForm" :model="form" ref="form">
                <el-form-item label="客户手机号:" >
                    <el-input v-model="form.customerPhone" placeholder="客户手机号" class="ipt100"></el-input>
                </el-form-item>
                <el-form-item label="客户姓名:" class="widthauto1">
                    <el-input v-model="form.customerName" placeholder="客户姓名" class="ipt100"></el-input>
                </el-form-item>
                <el-form-item label="资源ID:" class="widthauto1">
                    <el-input v-model="form.clueId" placeholder="资源ID"  @keyup.native="number" class="ipt100"></el-input>
                </el-form-item>
                <el-form-item label="客户级别:" class="widthauto1">
                    <el-select v-model="form.cusLevelList" placeholder="客户级别" clearable multiple :disabled="disabledCusLevelList">
                        <el-option
                                v-for="item in cusLevelArr"
                                :key="item.value"
                                :label="item.name"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="分配时间:" class="widthauto1">
                    <el-date-picker

                            v-model="form.distributionTimeStart"
                            type="datetime"
                            placeholder="选择日期时间"
                            :disabled="disabledCreateTime">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="—" class="widthauto">
                    <el-date-picker

                            v-model="form.distributionTimeEnd"
                            type="datetime"
                            placeholder="选择日期时间"
                            :disabled="disabledCreateTime">
                    </el-date-picker>
                </el-form-item>
                <!--
                <el-form-item label="">
                    <el-select v-model="form.cluesta" placeholder="资源有效性" style="width: 100%;" clearable >
                        <el-option
                            v-for="item in clueStatus"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                -->
                <el-row v-show="isShow">
                    <el-form-item label="搜索词:" >
                        <el-input v-model="form.searchWord" placeholder="搜索词"></el-input>
                    </el-form-item>
                    <el-form-item label="客户状态:" >
                        <el-select v-model="form.cusStatus" placeholder="客户状态" clearable>
                            <el-option
                                    v-for="item in cusStatusArr"
                                    :key="item.value"
                                    :label="item.name"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否邀约:" >
                        <el-select v-model="form.hasInvite" placeholder="是否邀约" clearable>
                            <el-option
                                    v-for="item in hasInvite"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!--  <el-form-item label="全部资源:" >
                         <el-select v-model="form.isTransfer" placeholder="全部资源" clearable >
                             <el-option
                                 v-for="item in isTransfer"
                                 :key="item.value"
                                 :label="item.label"
                                 :value="item.value">
                             </el-option>
                         </el-select>
                     </el-form-item> -->
                    <el-form-item label="创建时间:">
                        <el-date-picker
                                v-model="form.createTimeStart"
                                type="datetime"
                                placeholder="选择日期时间"
                        >
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="—" class="widthauto">
                        <el-date-picker
                                v-model="form.createTimeEnd"
                                type="datetime"
                                placeholder="选择日期时间"
                        >
                        </el-date-picker>
                    </el-form-item>

                    <el-form-item label="预签约省份:" >
                        <el-select v-model="form.province" placeholder="预签约省份" clearable>
                            <el-option
                                    v-for="item in provinceArr"
                                    :key="item.name"
                                    :label="item.name"
                                    :value="item.name">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="资源类别:" >
                        <el-select v-model="form.category" placeholder="资源类别" clearable>
                            <el-option
                                    v-for="item in categoryArr"
                                    :key="item.value"
                                    :label="item.name"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="重复手机号:" >
                        <el-select v-model="form.repeatStatus" placeholder="重复手机号" clearable >
                            <el-option
                                    v-for="item in clueRepeatStatus"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="编辑时间:" >
                        <el-date-picker
                                v-model="form.updateTimeStart"
                                type="datetime"
                                placeholder="选择日期时间">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="—" class="widthauto">
                        <el-date-picker

                                v-model="form.updateTimeEnd"
                                type="datetime"
                                placeholder="选择日期时间">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="今日是否拨打:" >
                        <el-select v-model="form.dayTel" placeholder="今日是否拨打" clearable>
                            <el-option
                                    v-for="item in callTel"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- <el-form-item label="">
                        <el-input v-model="form.address" placeholder="地址"></el-input>
                    </el-form-item> -->
                    <el-form-item label="当日是否跟访:" >
                        <el-select v-model="form.trackingDay" placeholder="当日是否跟访" clearable>
                            <el-option
                                    v-for="item in hastracking"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- <el-form-item label="客户级别:" >
                        <el-select v-model="form.cusLevelList" placeholder="客户级别" clearable multiple>
                            <el-option
                                    v-for="item in cusLevelArr"
                                    :key="item.value"
                                    :label="item.name"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item> -->
                    <el-form-item label="QQ:">
                        <el-input v-model="form.qq" placeholder="QQ" maxLength="20" @keyup.native="number"></el-input>
                    </el-form-item>
                    <el-form-item label="最后拨打时间:">
                        <el-date-picker
                                v-model="form.telEndTimeStart"
                                type="datetime"
                                placeholder="选择日期时间">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="—" class="widthauto">
                        <el-date-picker
                                v-model="form.telEndTimeEnd"
                                type="datetime"
                                placeholder="选择日期时间">
                        </el-date-picker>
                    </el-form-item>

                    <el-form-item label="微信:">
                        <el-input v-model="form.wechat" placeholder="微信"></el-input>
                    </el-form-item>
                    <el-form-item label="邮箱:">
                        <el-input v-model="form.email" placeholder="邮箱"></el-input>
                    </el-form-item>
                    <el-form-item label="资源是否有效:">
                        <el-select v-model="form.status" placeholder="资源是否有效" clearable >
                            <el-option
                                    v-for="item in comArr"
                                    :key="item.value"
                                    :label="item.name"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否接通:">
                        <el-select v-model="form.isCall" placeholder="是否接通" clearable >
                            <el-option
                                    v-for="item in comArr"
                                    :key="item.value"
                                    :label="item.name"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <br>
                    <el-form-item label="是否补齐尾款:">
                        <el-select v-model="form.isTailMoney" placeholder="是否补齐尾款" clearable>
                            <el-option v-for="item in isTailMoneyArr" :key="item.value" :label="item.label"
                                       :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="资源来源:">
                        <el-select v-model="form.teleReceiveSource" clearable placeholder="资源来源" :disabled="disabledTeleReceiveSource">
                            <el-option v-for="item in teleReceiveSourceArr" :key="item.value" :label="item.name" :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="当日跟访次数:" >
                        <el-select v-model="form.todayFollowNum" placeholder="当日跟访次数" clearable>
                            <el-option
                                    v-for="(item,index) in todayFollowNumArr"
                                    :key="index"
                                    :label="`${item}次`"
                                    :value="item">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否签约:" prop="isSign">
                        <el-select v-model="form.isSign" clearable placeholder="是否签约" :disabled="disabledIsSign">
                            <el-option v-for="item in isSignOptions" :key="item.value" :label="item.name" :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="手机号归属地:">
                        <el-input v-model="form.phoneLocale" placeholder="手机号归属地" ></el-input>
                    </el-form-item>
                    <el-form-item label="是否话务转化:">
                        <el-select v-model="form.phtraConversion" placeholder="是否话务转化" clearable>
                            <el-option v-for="item in phtraConversionArr" :key="item.value" :label="item.label"
                                       :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>



                </el-row>
                <div class="mainSearchBtnBox">
                    <el-button icon="el-icon-search" type="primary" @click="search" class="searchBtn">搜索</el-button>
                    <!-- <el-button type="info" class="searchBtn">取消</el-button> -->
                    <span style="color: #5c6be8;cursor: pointer;margin:0 10px;" @click="toogleClick"><span v-if="isShow">收起</span><span v-else>展开更多</span><i :class="{'greycolor paddingL6 el-icon-arrow-up':isShow,'greycolor paddingL6 el-icon-arrow-down':!isShow}"></i></span>
                </div>
            </el-form>
        </div>
        <el-row>
            <!-- @row-dblclick="showClueDetailInfo" -->
            <el-table
                    ref="multipleTable"
                    tooltip-effect="dark"
                    v-loading="loading"
                    style="width: 100%"
                    border
                    :data="dataTable"
                    @selection-change="handleSelectionChange"
                    @row-dblclick="customerEidt"
                    @row-click="clickRow"
                    :row-class-name="tableRowClassName"
            >
                <el-table-column align="center" type="selection"  prop="clueId"  @selection-change="handleSelectionChange" width="55"></el-table-column>
                <el-table-column align="center" type="index" label="序号" width="55"></el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-for="(item,key,index) in tableColums" v-if="item.fieldCode == 'cusName'">
                    <template slot-scope="scope">
                        {{scope.row.cusName}}
                        <span v-if="scope.row.inputType ==1">
                            <input type='hidden'><img th:src="@{/images/self_build.png}"  style="margin:0 10px;width:22px;cursor: pointer;vertical-align: middle;" alt="">
                        </span>
                        <span v-else-if="scope.row.phtraCustomerStatus ==4">
                            <input type='hidden'><img th:src="@{/images/fromTraffic.png}"  style="margin:0 10px;width:44px;cursor: pointer;vertical-align: middle;" alt="">
                        </span>
                    </template>
                </el-table-column>

                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else-if="item.fieldCode == 'phone'">
                    <!--  <template slot-scope="scope">{{scope.row.phone}}<input type='hidden'><img th:src="@{/images/tel.png}" @click="customerEidt(scope.row.clueId)" style="margin:0 10px;width:22px;cursor: pointer;vertical-align: middle;" alt=""><el-tag v-if="scope.row.tag">{{scope.row.tag}}</el-tag></template> -->
                    <template slot-scope="scope">
                        {{scope.row.phone}}<span v-if="scope.row.phoneLocale != null && scope.row.phoneLocale != ''">（{{scope.row.phoneLocale}}）</span>
                        <input type='hidden'><img th:src="@{/images/tel.png}" @click="gettelNumberIcon(scope.row.phone,scope.row.clueId)" style="margin:0 10px;width:22px;cursor: pointer;vertical-align: middle;" alt=""><el-tag v-if="scope.row.tag">{{scope.row.tag}}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else-if="item.fieldCode == 'phone2'">
                    <template slot-scope="scope">
                        {{scope.row.phone2}}<span v-if="scope.row.phone2Locale != null && scope.row.phone2Locale != ''">（{{scope.row.phone2Locale}}）</span>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else-if="item.fieldCode == 'phone3'">
                    <template slot-scope="scope">
                        {{scope.row.phone3}}<span v-if="scope.row.phone3Locale != null && scope.row.phone3Locale != ''"> （{{scope.row.phone3Locale}}）</span>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else-if="item.fieldCode == 'customerStatusName'">
                    <template slot-scope="scope">
                        {{scope.row.customerStatusName}}
                        <div v-if="scope.row.signList.length >=1"  v-for="it in scope.row.signList">
                            <el-button size="mini"  v-if="it.refundStatus==4 || it.refundStatus==6" type="text"  style="color: blue" @click="toReadOnlySignPage(it,scope.row)">{{it.signNo}}<span  style="color: red" >(已退款)</span></el-button>
                            <el-button size="mini"  v-else-if="it.refundStatus!=4 && it.refundStatus !=6" type="text"  style="color: blue" @click="toReadOnlySignPage(it,scope.row)">{{it.signNo}}</el-button>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width"
                                 v-else-if="item.fieldCode == 'isTrack'">
                    <template slot-scope="scope">
                        <div v-if="scope.row.isTrack === 1" @mouseenter="openTrackingDialogByhover(scope.row.clueId)">
                            <el-popover
                                    title="跟进记录"
                                    placement="top"
                                    width="1002"
                                    :open-delay=500
                                    trigger="hover">
                                <el-table ref="singleTable" tooltip-effect="dark" style="width: 100%" border :data="recordTable">
                                    <el-table-column align="center" type="index" width="30" label="序号"></el-table-column>
                                    <el-table-column align="center" prop="callTime" width="170" label="跟进时间"></el-table-column>
                                    <el-table-column align="center" prop="customerStatusName" label="客户状态" width="90"></el-table-column>
                                    <el-table-column align="center" prop="isConnect" :formatter="formatIsCall" label="是否接通" width="100"></el-table-column>
                                    <el-table-column align="center" prop="callDetailsName" label="客户关注点" width="300">
                                        <template slot-scope="scope">
                                            {{scope.row.callDetailsName}}
                                            <span v-if="scope.row.callDetailsName != null && scope.row.callDetailsName != ''">
                                            -</span>{{scope.row.focusPoint}}
                                        </template>

                                    </el-table-column>
                                    <el-table-column align="center" prop="nextVisitTime" label="下次回访时间" width="170"></el-table-column>
                                    <el-table-column align="center" prop="createUserName" label="创建人" width="140"></el-table-column>
                                </el-table>
                                <el-button slot="reference" @click.stop="openTrackingDialog(scope.row.clueId)"  type="text" size="small"> 点击查看<span style="color:red;">({{scope.row.trackNum}})</span> </el-button>
                            </el-popover>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width"
                                 v-else-if="item.fieldCode == 'repeatPhones'">
                    <template slot-scope="scope">
                        <div v-if="scope.row.isRepeatPhone === 1">
                            <el-button @click.stop="repeatPhonesClick(scope.row)" type="text" size="small">点击查看</el-button>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width"
                                 v-else-if="item.fieldCode == 'sex'">
                    <template slot-scope="scope">
                        <div v-if="scope.row.sex === 1">
                            男
                        </div>
                        <div v-else-if="scope.row.sex ===2">
                            女
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else-if="item.fieldCode == 'isCall'">
                    <template slot-scope="scope">
                        <div v-if="scope.row.isCall == 0">否</div>
                        <div v-else-if="scope.row.isCall ==1">是</div>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else-if="item.fieldCode == 'status'">
                    <template slot-scope="scope">
                        <div v-if="scope.row.status == 0">否</div>
                        <div v-else-if="scope.row.status ==1">是</div>
                    </template>
                </el-table-column>
                <el-table-column sortable align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width"
                                 v-else-if="item.fieldCode == 'teleReceiveTime'">
                    <template slot-scope="scope">
                        <!--<div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2 || scope.row.teleReceiveSource == 5">-->
                        {{scope.row.teleReceiveTime}}
                        <!--</div>-->
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width"
                                 v-else-if="item.fieldCode == 'hasRepeatClue'">
                    <template slot-scope="scope">
                        <span v-if="scope.row.hasRepeatClue ==1">
                           <el-button @click="showHasRepeatClue(scope.row)" type="text" size="small">点击查看</el-button>
                        </span>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width"
                                 v-else-if="item.fieldCode == 'sourceName'">
                    <template slot-scope="scope">
                        <span v-if="telemarketingLayoutSourceIsShow(scope.row.category)">
                           {{scope.row.sourceName}}
                        </span>
                    </template>
                </el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width"
                                 v-else-if="item.fieldCode == 'clueProjectName'">
                    <template slot-scope="scope">
                        <span v-if="telemarketingLayoutProjectIsShow(scope.row.category)">
                           {{scope.row.clueProjectName}}
                        </span>
                    </template>
                </el-table-column>
                <el-table-column align="center" sortable  :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else-if="item.fieldCode == 'distributionTime'||item.fieldCode == 'updateTime'||item.fieldCode == 'createTime'||item.fieldCode == 'storeArea' "></el-table-column>
                <el-table-column align="center" :key="item.fieldCode" :prop="item.fieldCode" :label="item.displayName" :width="item.width" v-else></el-table-column>
            </el-table>
            <table-pagination v-if="paginationShow" :pager="pager" :papernum="papernum" @change="initTableData"></table-pagination>
        </el-row>
    </div>
    <!-- dialog -->
    <el-dialog title="重单申请" :visible.sync="dialogFormVisible">
        <el-form :model="repeatApplyForm" ref="repeatApplyForm" :rules="repeatRules">
            <el-row>
                <el-form-item label="手机号：" :label-width="formLabelWidth" prop="phone">
                    <el-input v-model="repeatApplyForm.phone" placeholder="输入手机号后带出下面的资源列表" style="width: 60%;" @keyup.native="repeatApplyNumber" @change.native="repeatApplyNumber" maxLength="15"></el-input>
                    <!-- <el-button type="primary" @click="searchClue" :disabled="searchClueDisable">查询资源</el-button> -->
                    <el-button type="primary" @click="searchClue">查询资源</el-button>
                </el-form-item>
            </el-row>
            <el-row>
                <el-form-item label="匹配资源：" :label-width="formLabelWidth" prop="clue">
                    <el-select filterable v-model="repeatApplyForm.clue" placeholder="" style="width: 60%;">
                        <el-option
                                v-for="item in repeatClueArr"
                                :key="item.clueId"
                                :label="item.showReapet"
                                :value="item.clueId">
                        </el-option>
                    </el-select>
                </el-form-item>
            </el-row>
            <el-row>
                <el-form-item label="重单员工：" :label-width="formLabelWidth" prop="employee">
                    <el-select filterable v-model="repeatApplyForm.employee" @change="repeatApplyChangeTwo" placeholder="所有电销" style="width: 60%;">
                        <el-option
                                v-for="item in telePerArr"
                                :key="item.id"
                                :label="item.name"
                                :value="item.id">
                        </el-option>
                    </el-select>
                </el-form-item>
            </el-row>
            <el-row>
                <el-form-item label="重单手机号：" :label-width="formLabelWidth" prop="repeatPhone">
                    <el-input v-model="repeatApplyForm.repeatPhone" placeholder="输入手机号后带出下面的资源列表" style="width: 60%;" @keyup.native="repeatApplyRepeatNumber" @change.native="repeatApplyRepeatNumber" maxLength="15"></el-input>
                    <!-- <el-button type="primary" @click="searchRepeatClue" :disabled="searchRepeatClueDisable">查询资源</el-button> -->
                    <el-button type="primary" @click="searchRepeatClue">查询资源</el-button>
                </el-form-item>
            </el-row>
            <el-row>
                <el-form-item label="重单资源：" :label-width="formLabelWidth" prop="repeatClue">
                    <el-select filterable v-model="repeatApplyForm.repeatClue" placeholder="" style="width: 60%;">
                        <el-option
                                v-for="item in repeatCurClueArr"
                                :key="item.clueId"
                                :label="item.showReapet"
                                :value="item.clueId">
                        </el-option>
                    </el-select>
                </el-form-item>
            </el-row>





            <div v-if="isShowRepetition ==true">
                <el-row>
                    <el-form-item label="运作区域：" :label-width="formLabelWidth" prop="operatingArea">
                        <el-input v-model="repeatApplyForm.operatingArea"  style="width: 60%;" @keyup.native="repeatApplyNumber" maxLength="50"></el-input>
                    </el-form-item>
                </el-row>

                <el-row>
                    <el-form-item label="考察时间：" :label-width="formLabelWidth" prop="investigateTime">
                        <el-date-picker
                                style="width: 60%;"
                                v-model="repeatApplyForm.investigateTime"
                                type="datetime"
                                placeholder="选择日期时间">
                        </el-date-picker>
                    </el-form-item>
                </el-row>

                <el-row>
                    <el-form-item label="考察地点：" :label-width="formLabelWidth" prop="investigateArea">
                        <el-input v-model="repeatApplyForm.investigateArea"  style="width: 60%;" @keyup.native="repeatApplyNumber"  maxLength="50"></el-input>
                    </el-form-item>
                </el-row>

                <el-row>
                    <el-form-item label="考察项目：" :label-width="formLabelWidth" prop="investigateProjectId">
                        <el-select filterable  v-model="repeatApplyForm.investigateProjectId" multiple style="width: 60%;">
                            <el-option
                                    v-for="item in proSelect"
                                    :key="item.id"
                                    :label="item.projectName"
                                    :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-row>

                <el-row>
                    <el-form-item label="协商结果：" :label-width="formLabelWidth" prop="consultResults">
                        <el-select filterable  v-model="repeatApplyForm.consultResults" placeholder="选择项目" style="width: 60%;">
                            <el-option
                                    v-for="item in consultResultsArr"
                                    :key="item.value"
                                    :label="item.name"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-row>
            </div>






            <el-row>
                <el-form-item label="备注：" :label-width="formLabelWidth" prop="textarea">
                    <el-input
                            style="width: 60%;"
                            type="textarea"
                            :rows="4"
                            placeholder=""
                            maxLength="500"
                            v-model="repeatApplyForm.textarea">
                    </el-input>
                </el-form-item>
            </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer" style="text-align:center;">
            <el-button type="primary" :disabled="btnDisabled" @click="submitForm('repeatApplyForm')">确 定</el-button>
            <el-button @click="dialogFormVisible = false" >取 消</el-button>
        </div>
    </el-dialog>
    <!-- 释放资源 -->
    <el-dialog title="选择释放原因" :visible.sync="releaseFormVisible">
        <el-form :model="releaseForm" ref="releaseForm" :rules="releaseRules">
            <el-row>
                <el-form-item label="释放原因：" :label-width="formLabelWidth" prop="reason">
                    <el-select v-model="releaseForm.reason" placeholder="请选择" style="width: 60%;">
                        <el-option
                                v-for="item in reasonArr"
                                :key="item.value"
                                :label="item.name"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
            </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="submitreleaseForm('releaseForm')">提 交</el-button>
            <el-button @click="releaseFormVisible = false" >取 消</el-button>
        </div>
    </el-dialog>
    <!-- 跟进记录 -->
    <el-dialog title="跟进记录" :visible.sync="recordDialog">
        <el-table ref="singleTable" tooltip-effect="dark" style="width: 100%" border :data="recordTable">
            <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
            <el-table-column align="center" prop="callTime" label="跟进时间"></el-table-column>
            <el-table-column align="center" prop="status" label="客户状态"></el-table-column>
            <el-table-column align="center" prop="isConnect" label="是否接通"></el-table-column>
            <el-table-column align="center" prop="isNeedResource" label="资源有效性"></el-table-column>
            <el-table-column align="center" prop="isInvite" label="是否邀约"></el-table-column>
            <el-table-column align="center" prop="customerFocus" label="客户关注点"></el-table-column>
            <!--<el-table-column align="center" prop="isReturnVisit" label="是否继续回访"></el-table-column>  -->
            <el-table-column align="center" prop="nextTimeVisit" label="下次回访时间"></el-table-column>
            <el-table-column align="center" prop="createPerson" label="创建人"></el-table-column>
        </el-table>
    </el-dialog>
    <!-- 重复手机号 -->
    <el-dialog :title="'资源ID'+dailogTitleType+'重复手机号资源信息'"    :visible.sync="repeatPhonesDialog" width="1000px">
        <div v-show="showPhoneTable">
            <p style="margin:10px 0;">手机号<span style="color: red">(1)</span>{{phone}}重复手机号资源</p>
            <el-table ref="singleTable" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable2">
            <p style="margin:10px 0;">手机号<span style="color: red">(2)</span>{{phone2}}重复手机号资源</p>
            <el-table ref="singleTable2" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable2">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable3">
            <p style="margin:10px 0;">手机号<span style="color: red">(3)</span>{{phone3}}重复手机号资源</p>
            <el-table ref="singleTable3" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable3">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable4">
            <p style="margin:10px 0;">手机号<span style="color: red">(4)</span>{{phone4}}重复手机号资源</p>
            <el-table ref="singleTable4" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable4">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable5">
            <p style="margin:10px 0;">手机号<span style="color: red">(5)</span>{{phone5}}重复手机号资源</p>
            <el-table ref="singleTable5" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable5">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
    </el-dialog>

    <dialog-tracking :param="trackingParam"></dialog-tracking>
    <!-- 自定义列 -->
    <el-dialog title="自定义列" :visible.sync="dialogChooseList" class="elCheckboxGroup" width="870px">
        <el-form :model="fieldFrom">
            <el-form-item label="" prop="type">
                <el-checkbox-group v-model="fieldFrom.type">
                    <el-checkbox :label="item.sortNum+'_'+item.fieldCode+'_'+item.displayName+'_'+item.id+'_'+item.width"  name="type" :key="item.fieldCode"  v-for="(item,index) in  allTableColums ">
                        {{item.displayName}}
                    </el-checkbox>
                </el-checkbox-group>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="confirmColumn">确 定</el-button>
            <el-button @click="dialogChooseList = false">取 消</el-button>
        </div>
    </el-dialog>
    <el-dialog title="重复资源信息" :visible.sync="dialogFormVisible1" width="870px">
        <el-form :model="dialogForm" ref="dialogForm" class="marginB10 dialogForm" v-for="item in repeatClueList" height="600">
            <div class="fs16 redcolor marginB20">重复时间：{{formatTimeFn(item.discoverTime)}}</div>
            <div class="borderbox padding10">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="客户姓名：" :label-width="formLabelWidth">{{item.clueDTO.clueCustomer.cusName}}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="手机号：" :label-width="formLabelWidth" >{{getPhones(item.clueDTO.clueCustomer)}}</el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="微信：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueCustomer.wechat}}<span @click="lookWechat(item.clueDTO.clueCustomer)" v-if="(item.clueDTO.clueCustomer.wechat2 !=null && item.clueDTO.clueCustomer.wechat2 !='')||(item.clueDTO.clueCustomer.wechatCode !=null && item.clueDTO.clueCustomer.wechatCode !='')" style="color: rgb(0, 114, 255); cursor: pointer;">查看更多</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="邮箱：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueCustomer.email}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="QQ：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueCustomer.qq}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="资源类型：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueBasic.typeName}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="留言时间：" :label-width="formLabelWidth">
                            {{formatTimeFn(item.clueDTO.clueBasic.messageTime)}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="资源类别：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueBasic.categoryName}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="搜索词：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueBasic.searchWord}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="留言重点：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueBasic.messagePoint}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="地域信息：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueIntention.address}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="备注：" :label-width="formLabelWidth">
                            {{item.clueDTO.clueBasic.remark}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <div v-if="telemarketingLayout !=null && (','+telemarketingLayout.category+',').indexOf(','+item.clueDTO.clueBasic.category+',') != -1">
                    <el-row >
                        <el-col :span="12" v-if="telemarketingLayout.projectShow ==1">
                            <el-form-item label="资源项目：" :label-width="formLabelWidth">
                                {{item.clueDTO.clueProject.projectName}}
                            </el-form-item>
                        </el-col>
                        <el-col :span="12" v-if="telemarketingLayout !=null && telemarketingLayout.sourceShow ==1">
                            <el-form-item label="媒介：" :label-width="formLabelWidth">
                                {{item.clueDTO.clueBasic.sourceName}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12" v-if="telemarketingLayout !=null && telemarketingLayout.adShow ==1">
                            <el-form-item label="广告文案：" :label-width="formLabelWidth">
                                {{item.clueDTO.clueBasic.ad}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12" v-if="telemarketingLayout !=null && telemarketingLayout.urlShow ==1">
                            <el-form-item label="URL：" :label-width="formLabelWidth">
                                {{item.clueDTO.clueReceive.urlAddress}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
            </div>
        </el-form>
    </el-dialog>

    <el-dialog title="查看微信/二维码" :visible.sync="repeatWechatVisible">
        <el-form :model="repeatWeDialogForm" ref="repeatWeDialogForm">
            <!--展示phone2  phone3  phone4 phone5-->
            <el-form-item  label="微信2：" :label-width="formLabelWidth"  >
                <el-button type="text" disabled>{{repeatCustomer.wechat2}}</el-button>
            </el-form-item>
            <el-form-item  label="图片二维码：" :label-width="formLabelWidth"  >
                <img v-show="repeatCustomer.wechatCode!=''"  :src="repeatCustomer.wechatCode">
            </el-form-item>
        </el-form>
    </el-dialog>
</div>
</body>
<!-- import Vue before Element -->
<div th:include="_footer_include :: #jsLib"></div>
<!-- <script type="text/javascript" src="//agent-gateway-2.cticloud.cn/js/agent/v10/cti-link.js"></script>
<script th:src="@{/js/custom/call/md5.js?v=1.0.0}"></script>
<script th:src="@{/js/custom/call/toolbar.js?v=1.0.1}"></script>
<script th:src="@{/js/custom/call/toolbarIframe.js?v=1.0.1}"></script>
<script th:src="@{/js/custom/call/timer.js?v=1.0.1}"></script>
<script th:src="@{/js/custom/call/rtCall.js?v=1.0.0}"></script>  -->
<!-- 播放錄音 js -->
<!-- <script th:src="@{/js/custom/callrecord/simpleAudio.js?v=1.0.0}"></script> -->
<script th:inline="javascript" >
    var businessLine=[[${businessLine}]];//自定义字段
    var fieldList=[[${fieldList}]];//自定义字段
    var userFieldList=[[${userFieldList}]];//用户自定义字段
    var proSelect = [[${proSelect}]];//可签约项目
    var isShowRepetition = [[${isShowRepetition}]];//业务线
    var todayFollowNumList = [[${todayFollowNumList}]];//电销今日跟访次数下拉列表值
    var telemarketingLayout = [[${telemarketingLayout}]];
    //角色编码
    var roleCode = [[${roleCode}]];
    var mycustomVM=new Vue({
        el: '#myCustom',
        data: function() {
            return {
                isShowCreate:true,//默认显示新建客户资源
                recordDialoghover:true,
                telemarketingLayout:telemarketingLayout,
                dialogForm: {
                    phoneNum: ''
                },
                repeatWeDialogForm:{},
                repeatWechatVisible:false,
                repeatCustomer:{},
                dialogFormVisible1:false,
                repeatClueList:[],
                disabledIsSign:false,//是否签约默认可选
                disabledCreateTime:false,//默认可选
                disabledTeleReceiveSource:false,//默认可选
                disabledCusLevelList:false,//默认可选
                dataUrlParam:{
                    dataUrlArr:[{//0
                        isActive:false,
                        name:"未签约客户",
                        url:"/tele/clueMyCustomerInfo/initmyCustomer?type=1",
                    },{//1
                        isActive:false,
                        name:"今日新增",
                        url:"/tele/clueMyCustomerInfo/initmyCustomer?type=2"
                    },
                        {//2
                            isActive:false,
                            name:"今日回访",
                            url:"/tele/clueMyCustomerInfo/customerVisitToday"
                        },
                        {//3
                            isActive:false,
                            name:"今日领取",
                            url:"/tele/clueMyCustomerInfo/initmyCustomer?type=5"
                        },
                        {//4
                            isActive:false,
                            name:"自建客户",
                            url:"/tele/clueMyCustomerInfo/initmyCustomer?type=3"
                        },
                        {//5
                            isActive:false,
                            name:"重单客户",
                            url:"/clue/cluerepetition/queryRepeatPage?type=1"
                        },
                        {//6
                            isActive:false,
                            name:"邀约客户",
                            url:"/clue/appiontment/initAppiontmentList?type=1"
                        },
                        {//7
                            isActive:false,
                            name:"已签约客户",
                            url:" /tele/clueMyCustomerInfo/initmyCustomer?type=4"
                        }]
                },
                dataUrlParamHJ:{
                    dataUrlArr:[{//0
                        isActive:false,
                        name:"未签约客户",
                        url:"/tele/clueMyCustomerInfo/initmyCustomer?hJtype=1",
                        type:"hJtype"
                    },{//1
                        isActive:false,
                        name:"今日新增",
                        url:"/tele/clueMyCustomerInfo/initmyCustomer?hJtype=2",
                        type:"hJtype"
                    },
                        {//2
                            isActive:false,
                            name:"今日回访",
                            url:"/tele/clueMyCustomerInfo/customerVisitToday?hJtype=1",
                            type:"hJtype"
                        },{//3
                            isActive:false,
                            name:"VIP客户",
                            url:"/tele/clueMyCustomerInfo/initmyCustomer?hJtype=3",
                            type:"hJtype"
                        },{//4
                            isActive:false,
                            name:"重要客户",
                            url:"/tele/clueMyCustomerInfo/initmyCustomer?hJtype=4",
                            type:"hJtype"
                        },
                        {//5
                            isActive:false,
                            name:"今日领取",
                            url:"/tele/clueMyCustomerInfo/initmyCustomer?hJtype=5",
                            type:"hJtype"
                        },
                        {//6
                            isActive:false,
                            name:"自建客户",
                            url:"/tele/clueMyCustomerInfo/initmyCustomer?hJtype=6",
                            type:"hJtype"
                        },
                        {//7
                            isActive:false,
                            name:"已签约客户",
                            url:" /tele/clueMyCustomerInfo/initmyCustomer?hJtype=7",
                            type:"hJtype"
                        }]
                },
                isElBreadcrumb:true,
                paginationShow: false,
                btnDisabled: false,
                searchClueDisable:true,//查询资源默认不可点击
                searchRepeatClueDisable:true,//查询资源默认不可点击
                isShow:false,
                dialogFormVisible: false,
                releaseFormVisible:false,
                recordDialog:false,
                repeatPhonesDialog:false,
                tmOutboundCallDialogVisible:false,
                loading:false,
                isShowRepetition:isShowRepetition,
                dailogTitleType:'',
                form: {
                    isTransfer:'',
                    cluesta:'',
                    customerPhone:'',
                    customerName:'',
                    cusStatus:'',
                    cusLeve:'',
                    cusLevelList:[],
                    updateTimeStart:'',
                    updateTimeEnd:'',
                    createTimeStart:'',
                    createTimeEnd:'',
                    telEndTimeStart:'',
                    telEndTimeEnd:'',
                    distributionTimeStart:'',
                    distributionTimeEnd:'',
                    dayTel:'',
                    hasInvite:'',
                    repeatStatus:'',
                    province:'',
                    category:'',
                    category:'',
                    searchWord:'',
                    address:'',
                    trackingDay:'',
                    clueId:'',
                    qq:"",
                    wechat:"",
                    status:"",
                    isCall:"",
                    email:"",
                    isTailMoney:"",
                    isSign:"",
                    teleReceiveSource:"",
                    todayFollowNum:"",
                    phoneLocale:"",
                    phtraConversion:"",
                },
                todayFollowNumArr:todayFollowNumList,
                teleReceiveSourceArr:[
                    {value:"1",name:"分配"},
                    {value:"3",name:"领取"},
                    {value:"4",name:"自建"},
                    {value:"5",name:"分发"},
                    {value:"6",name:"平台"},
                    {value:"7",name:"自动分配"}
                ],
                consultResultsArr:[
                    {value:"0",name:"平分"},
                    {value:"1",name:"判定"}
                ],
                comArr:[
                    {value:"",name:"全部"},
                    {value:"1",name:"是"},
                    {value:"0",name:"否"}
                ],
                repeatApplyForm: {
                    phone:'',
                    clue:'',
                    employee:'',
                    repeatPhone:'',
                    repeatClue:'',
                    textarea:'',
                    operatingArea:'',
                    consultResults:'0',
                    investigateProjectId:'',
                    investigateArea:'',
                    investigateTime:''
                },
                releaseForm:{
                    reason:''
                },

                multseleSelection:[],
                pager:{
                    total: 0,
                    currentPage: 1,
                    pageSize: 20,
                },
                papernum:[20, 50, 100,500],
                formLabelWidth: '150px',
                dataTable: [],
                reasonArr:[],
                telePerArr:[],
                repeatCurClueArr:[],
                cusLevelArr:[],
                categoryArr:[],
                repeatClueArr:[],
                provinceArr:[],
                trackingParam:{
                    trackingDialogVisible:false,
                    tableData:[]
                },
                isTailMoneyArr: [{value: '', label: '全部'}, {value: '0', label: '否'}, {value: '1', label: '是'}],
                phtraConversionArr: [{value: '', label: '全部'}, {value: '0', label: '否'}, {value: '1', label: '是'}],
                isSignOptions: [{
                    value: 0,
                    name: "未签约"
                }, {
                    value: 1,
                    name: "已签约"
                }],
                isTransfer:[
                    {
                        value: '0',
                        label: '新资源' },
                    {
                        value: '1',
                        label: '转来资源'
                    }
                ],
                clueStatus:[
                    {
                        value: '1',
                        label: '有效'
                    },
                    {
                        value: '0',
                        label: '无效'
                    }
                ],
                callTel:[
                    {
                        value: '1',
                        label: '是'
                    },
                    {
                        value: '0',
                        label: '否'
                    }
                ],
                hasInvite:[
                    {
                        value: '0',
                        label: '未邀约'
                    },
                    {
                        value: '1',
                        label: '邀约'
                    }
                ],
                clueRepeatStatus:[
                    {
                        value: '0',
                        label: '否'
                    },
                    {
                        value: '1',
                        label: '是'
                    }
                ],
                hastracking:[
                    {
                        value: '0',
                        label: '未跟访'
                    },
                    {
                        value: '1',
                        label: '跟访'
                    }
                ],

                options: [{
                    value: '选项1',
                    label: '黄金糕'
                }, {
                    value: '选项2',
                    label: '双皮奶'
                }, {
                    value: '选项3',
                    label: '蚵仔煎'
                }, {
                    value: '选项4',
                    label: '龙须面'
                }, {
                    value: '选项5',
                    label: '北京烤鸭'
                }],
                value: '',//下拉选项默认值
                recordTable:[
                    {
                        callTime:'',
                        status:'',
                        isConnect:'是',
                        isNeedResource:'是',
                        isInvite:'是',
                        customerFocus:'',
                        isReturnVisit:'是',
                        nextTimeVisit:'',
                        createPerson:'张三',
                    },
                    {
                        callTime:'',
                        status:'',
                        isConnect:'否',
                        isNeedResource:'否',
                        isInvite:'否',
                        customerFocus:'',
                        isReturnVisit:'否',
                        nextTimeVisit:'',
                        createPerson:'李四',
                    }
                ],
                proSelect:proSelect,
                repeatPhonesTable:[],
                repeatPhonesTable2:[],
                repeatPhonesTable3:[],
                repeatPhonesTable4:[],
                repeatPhonesTable5:[],
                showPhoneTable:false,
                showPhoneTable2:false,
                showPhoneTable3:false,
                showPhoneTable4:false,
                showPhoneTable5:false,
                phone:'',
                phone2:'',
                phone3:'',
                phone4:'',
                phone5:'',
                cusStatusArr:[],
                repeatRules:{
                    phone:[
                        { required: true, message: '请输入手机号', trigger: 'blur' },
                        { validator:function(rule,value,callback){
                                if(/^[0-9]*$/.test(value) == false){
                                    callback(new Error("请输入数字"));
                                    return
                                }
                                if(value.length!==11){
                                    callback(new Error("请输入11位数字"));
                                    return
                                }
                                callback();
                            }, trigger: 'blur'}
                    ],
                    clue: [
                        { required: true, message: '请选择匹配资源', trigger: 'blur' }
                    ],
                    employee: [
                        { required: true, message: '请选择重单员工', trigger: 'blur' },
                    ],
                    repeatPhone: [
                        { required: true, message: '请输入重单手机号', trigger: 'blur' },
                        { validator:function(rule,value,callback){
                                if(/^[0-9]*$/.test(value) == false){
                                    callback(new Error("请输入数字"));
                                    return
                                }
                                if(value.length!==11){
                                    callback(new Error("请输入11位数字"));
                                    return
                                }
                                callback();
                            }, trigger: 'blur'}
                    ],
                    repeatClue: [
                        { required: true, message: '请选择重单资源', trigger: 'blur' }
                    ],
                    operatingArea: [
                        { required: true, message: '请输入运作区域', trigger: 'blur' },
                        { validator:function(rule,value,callback){
                                if(isShowRepetition){
                                    callback();
                                }
                            }, trigger: 'blur'}
                    ],
                    investigateTime: [
                        { required: true, message: '请选择考察时间', trigger: 'blur' },
                        { validator:function(rule,value,callback){
                                if(isShowRepetition){
                                    callback();
                                }
                            }, trigger: 'blur'}
                    ],
                    investigateArea: [
                        { required: true, message: '请输入考察地点', trigger: 'blur' },
                        { validator:function(rule,value,callback){
                                if(isShowRepetition){
                                    callback();
                                }
                            }, trigger: 'blur'}
                    ],
                    investigateProjectId: [
                        { required: true, message: '请选择考察项目', trigger: 'blur' },
                        { validator:function(rule,value,callback){
                                if(isShowRepetition){
                                    callback();
                                }
                            }, trigger: 'change'}
                    ],
                    consultResults: [
                        { required: true, message: '请选择协商结果', trigger: 'blur' },
                        { validator:function(rule,value,callback){
                                if(isShowRepetition){
                                    callback();
                                }
                            }, trigger: 'change'}
                    ],

                },
                releaseRules:{
                    reason: [
                        { required: true, message: '请选择释放原因', trigger: 'blur' }
                    ]
                },
                dialogChooseList:false,//自定义列
                fieldFrom: {
                    type: [],
                },
                allTableColums:[],
                tableColums:[],

                storeForm: {
                    isTransfer:'',
                    cluesta:'',
                    customerPhone:'',
                    customerName:'',
                    cusStatus:'',
                    cusLeve:'',
                    updateTimeStart:'',
                    updateTimeEnd:'',
                    createTimeStart:'',
                    createTimeEnd:'',
                    telEndTimeStart:'',
                    telEndTimeEnd:'',
                    distributionTimeStart:'',
                    distributionTimeEnd:'',
                    dayTel:'',
                    hasInvite:'',
                    repeatStatus:'',
                    province:'',
                    category:'',
                    category:'',
                    searchWord:'',
                    address:'',
                    trackingDay:'',
                    clueId:'',
                    qq:"",
                    wechat:"",
                    status:"",
                    isCall:"",
                    email:""
                },
                storeId: '',
                scrollTop: 0,
            }
        },
        methods: {
            formatIsCall(row, column){
                //是否接通
                console.log(row)
                return row.isCall==0?"否": row.isCall==1?"接通/微信沟通":""
            },
            tableRowClassName({row, rowIndex}) {
                console.log(row)
                if (row.customerStatusName === "未联系") {
                    return 'warning-row';
                }
                return '';
            },
            repeatApplyChangeTwo(){
                this.repeatApplyForm.repeatClue = "";
                this.repeatApplyForm.repeatPhone="";
                this.repeatCurClueArr=[];
            },
            async gettelNumberIcon(tel,clueId) {
                var isReturn =false;
                await axios.post('/call/callRecord/missedCalPhone?phone='+tel, {})
                    .then(function (response) {
                        if(response.data !=""){
                            mycustomVM.$message({
                                message: response.data,
                                type: 'warning'
                            });
                            isReturn = true; ;
                        }
                        ;
                    });
                if(isReturn){
                    return;
                }
                //外呼手机
                var param = {};
                param.clueId = clueId;
                //客户维护界面
                this.setSessionStore("storeForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("otherVal", otherVal);

                window.parent.parent.outboundCallPhone(tel, 2, clueId, function (res) {
                    axios.post('/tele/clueMyCustomerInfo/updateCallTime', param).then(function (response) {
                    });
                });
                //跳转页面
                this.showClueDetailInfo2(clueId);

            },
            clickRow(row){
                this.$refs.multipleTable.toggleRowSelection(row)
            },
            search(){
                this.pager.currentPage =1;
                this.initTableData();
            },
            initTableData(){
                var param = {};
                var pageSize = this.pager.pageSize;
                var pageNum = this.pager.currentPage;
                // 存储
                localStorage.setItem('myCustomPageSize', pageSize);
                param.pageNum=pageNum;
                param.pageSize=pageSize;
                param.isTransfer=this.form.isTransfer;
                param. status=this.form.cluesta;
                param.phone=this.form.customerPhone ;
                param.cusName=this.form.customerName;
                param.customerStatus=this.form.cusStatus;
                param.cusLevel=this.form.cusLeve;
                param.cusLevels = this.form.cusLevelList;
                param.updateTimeStart=this.form.updateTimeStart;
                param.updateTimeEnd=this.form.updateTimeEnd;
                param.createTimeStart=this.form.createTimeStart;
                param.createTimeEnd=this.form.createTimeEnd;
                param.distributionTimeStart=this.form.distributionTimeStart;
                param.distributionTimeEnd=this.form.distributionTimeEnd;
                param.telEndTimeStart=this.form.telEndTimeStart;
                param.telEndTimeEnd=this.form.telEndTimeEnd;
                param.isCall=this.form.isCall;
                param.status=this.form.status;
                param.dayTel=this.form.dayTel;
                param.hasInvite=this.form.hasInvite;
                param.repeatStatus=this.form.repeatStatus;
                param.province= this.form.province;
                param.category= this.form.category;
                //param.address= this.form.address;
                param.searchWord= this.form.searchWord;
                param.trackingDay= this.form.trackingDay;
                param.clueId = this.form.clueId;
                param.qq = this.form.qq;
                param.email = this.form.email;
                param.wechat = this.form.wechat;
                param.isSign = this.form.isSign;
                param.isTailMoney = this.form.isTailMoney;
                param.teleReceiveSource = this.form.teleReceiveSource;
                param.todayFollowNum = this.form.todayFollowNum;
                param.phoneLocale = this.form.phoneLocale;
                param.phtraConversion = this.form.phtraConversion;
                this.loading=true;
                axios.post('/tele/clueMyCustomerInfo/findTeleClueInfo',param).then(function (response) {
                    if(!response){
                        mycustomVM.$message({
                            message: "接口调用失败",
                            type: 'error'
                        });
                        return ;
                    }
                    var resobj= response.data;
                    if(!resobj){
                        mycustomVM.$message({
                            message: "接口调用失败",
                            type: 'error'
                        });
                        return ;
                    }
                    if(resobj.code!='0'){
                        mycustomVM.$message({
                            message: "接口调用失败",
                            type: 'error'
                        });
                        return ;
                    }
                    var pageData=resobj.data;
                    var data=pageData.data;
                    for(var i=0;i<data.length;i++){
                        data[i].urgentDate=mycustomVM.dateFormat(null,null,data[i].urgentDate,null);
                    }
                    mycustomVM.pager.total=pageData.total;
                    mycustomVM.pager.currentPage = pageData.currentPage;
                    mycustomVM.pager.pageSize = pageData.pageSize;
                    mycustomVM.dataTable =pageData.data;
                    mycustomVM.loading=false;

                    // 取出存储的id
                    if(!mycustomVM.paginationShow){
                        if(mycustomVM.storeId){
                            mycustomVM.$nextTick(function(){
                                var storage = [];
                                mycustomVM.dataTable.forEach(function(item, index){
                                    if(item.clueId === mycustomVM.storeId ){
                                        storage.push(mycustomVM.dataTable[index]);
                                    }
                                })
                                mycustomVM.toggleSelection(storage);

                                mycustomVM.$el.querySelector('.el-table__body-wrapper').scrollTop = mycustomVM.scrollTop;

                            })
                        }
                    }else{
                        mycustomVM.removeSessionStore ("storeForm");
                        mycustomVM.removeSessionStore ("otherVal");
                    }
                    mycustomVM.paginationShow = true;
                    mycustomVM.storeForm = mycustomVM.form;
                })
            },
            toggleSelection(rows) { // table select 默认选中fn
                if (rows) {
                    rows.forEach(row => {
                        this.$refs.multipleTable.toggleRowSelection(row,true);
                    });
                } else {
                    this.$refs.multipleTable.clearSelection();
                }
            },
            toReadOnlySignPage(row,tele){  // 进入签约单明细
                var clueId=row.clueId;
                //客户维护界面
                this.setSessionStore("storeForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("otherVal", otherVal);

                window.location.href='/businesssign/myCustomSignRecordPage?clueId='+row.clueId+"&signId="+row.signId+"&readyOnly=1&createUser="+tele.teleSaleId+"&type=1";
            },
            //日期数据格式化方法
            dateFormat(row, column, cellValue, index) {
                if (cellValue == undefined) {
                    return "";
                }
                return moment(cellValue).format("YYYY-MM");
            },
            //展现详情
            showClueDetailInfo (row, column) {
                window.location.href='/tele/clueMyCustomerInfo/customerInfoReadOnly?clueId='+row.clueId;
            },
            //展现详情
            showClueDetailInfo2 (clueId) {
                // 为详情页“下一条”数据拼装
                var clueIdPin = mycustomVM.dataTable.map(function(obj,index){
                    return obj.clueId;
                }).join(",");
                var hJtype=getQueryString("hJtype");
                // Post方式调转到编辑页面
                locationPost("/tele/clueMyCustomerInfo/customerEditInfo" , {"clueId":clueId,"hJtype":hJtype , "nextClueIds":clueIdPin});
            },
            createClueData(){
                window.location.href='/tele/clueMyCustomerInfo/createClue';
            },
            toogleClick(){
                if(this.isShow){
                    this.isShow=false
                }else{
                    this.isShow=true
                }
            },
            closeTmOutboundDialog(){//关闭电销外呼dialog
                this.tmOutboundCallDialogVisible = false;
                clearTimer();//清除定时器
            },
            openFormInfo(){
                this.dialogFormVisible = true;
                if(this.$refs['repeatApplyForm']) {
                    this.$refs['repeatApplyForm'].resetFields();
                }
            },
            openeleaseForm(){
                var rows = this.multseleSelection;
                if(rows.length <1){
                    this.$message({
                        message: '请选择释放资源',
                        type: 'warning'
                    });
                    return;
                }else{
                    this.releaseFormVisible=true;
                    if(this.$refs['releaseForm']) {
                        this.$refs['releaseForm'].resetFields();
                    }
                }

            },
            searchClue(){
                //重单申请查询资源
                if(this.repeatApplyForm.phone==""){
                    this.$message({
                        message: '请输入手机号',
                        type: 'warning'
                    });
                    return;
                }
                var phone= this.repeatApplyForm.phone;
                var param={};
                param.phone=phone;
                this.repeatApplyForm.clue="";
                axios.post('/tele/clueMyCustomerInfo/queryRepeatClue',param).then(function (response) {
                    mycustomVM.repeatClueArr=response.data.data;
                })
            },
            openTrackingDialogByhover(cid){
                var param = {};
                param.clueId = cid;
                axios.post('/aggregation/tracking/queryList', param)
                    .then(function (response) {
                        if (response.data.code == 0) {
                            mycustomVM.recordTable = response.data.data
                        } else {
                            mycustomVM.$message.error(response.data.msg);
                        }
                    }).catch(function (error) {
                });

            },
            openTrackingDialog(cid){
                var param = {};
                param.clueId = cid;
                axios.post('/aggregation/tracking/queryList', param)
                    .then(function (response) {
                        if (response.data.code == 0) {
                            mycustomVM.trackingParam.tableData = response.data.data
                            mycustomVM.trackingParam.trackingDialogVisible = true;
                        } else {
                            mycustomVM.$message.error(response.data.msg);
                        }
                    }).catch(function (error) {
                });

            },
            searchRepeatClue(){
                //重单申请查询资源
                if(this.repeatApplyForm.repeatPhone==""){
                    this.$message({
                        message: '请输入重单手机号',
                        type: 'warning'
                    });
                    return;
                }
                var repeatPhone= this.repeatApplyForm.repeatPhone;
                var employee= this.repeatApplyForm.employee;
                var param={};
                param.telemarketingId=employee
                this.repeatApplyForm.repeatClue="";
                param.phone=repeatPhone;
                console.log(param.phone)
                axios.post('/tele/clueMyCustomerInfo/queryRepeatCurClue',param).then(function (response) {
                    mycustomVM.repeatCurClueArr=response.data.data;
                })

            },
            handleSelectionChange(val) {
                this.multseleSelection = val;
            },
            // customerEidt(clueId,phone){
            //  //客户维护界面
            //   window.location.href="/tele/clueMyCustomerInfo/customerEditInfo?clueId="+clueId;
            // },
            customerEidt(row){
                var clueId=row.clueId;
                //客户维护界面
                this.setSessionStore("storeForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("otherVal", otherVal);
                var type=getQueryString("type");
                var hJtype=getQueryString("hJtype");

                /**************************************/
                // 为详情页“下一条”数据拼装
                var clueIdPin = mycustomVM.dataTable.map(function(obj,index){
                    return obj.clueId;
                }).join(",");
                if(type){
                    // Post方式调转到编辑页面
                    locationPost("/tele/clueMyCustomerInfo/customerEditInfo" , {"clueId":clueId,"type":type , "nextClueIds":clueIdPin});
                }else{
                    // Post方式调转到编辑页面
                    locationPost("/tele/clueMyCustomerInfo/customerEditInfo" , {"clueId":clueId,"hJtype":hJtype , "nextClueIds":clueIdPin});
                }
            },
            submitForm(formName) {
                //重单提交
                this.$refs[formName].validate((valid) => {
                    if (valid) {

                        var repeatPhone=this.repeatApplyForm.repeatPhone;

                        var  phone=this.repeatApplyForm.phone;

                        var employee= this.repeatApplyForm.employee;

                        var clue=this.repeatApplyForm.clue;

                        var repeatClue=this.repeatApplyForm.repeatClue;

                        var textarea= this.repeatApplyForm.textarea;

                        var operatingArea = this.repeatApplyForm.operatingArea ;
                        var investigateTime  = this.repeatApplyForm.investigateTime   ;
                        var investigateArea = this.repeatApplyForm.investigateArea ;
                        var  param={};
                        if(this.repeatApplyForm.investigateProjectId !=null && this.repeatApplyForm.investigateProjectId !=''){
                            var investigateProjectId = this.repeatApplyForm.investigateProjectId.join(',')   ;
                            param.investigateProjectId = investigateProjectId;
                        }

                        var consultResults = this.repeatApplyForm.consultResults ;



                        param.clueId=clue;

                        param.phone=phone;

                        param.repeatClueId=repeatClue;

                        param.repeatUserId=employee;

                        param.repeatPhone=repeatPhone;
                        param.operatingArea = operatingArea ;
                        param.investigateTime = investigateTime;
                        param.investigateArea = investigateArea;
                        param.consultResults = consultResults;
                        param.remark=textarea;
                        this.dialogFormVisible = false;

                        this.btnDisabled = true;

                        axios.post('/tele/clueMyCustomerInfo/saveRepeatClue', param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mycustomVM.$message({message:'操作成功',type:'success',duration:2000,onClose:function(){

                                            mycustomVM.btnDisabled = false;
                                            mycustomVM.initTableData();
                                        }});
                                }else{
                                    mycustomVM.$message({
                                        message: response.data.msg,
                                        type: 'warning'
                                    });
                                    mycustomVM.btnDisabled = false;
                                }
                            }).catch(function (error) {
                            mycustomVM.btnDisabled = false;
                        });
                    } else {
                        return false;
                    }
                });
            },
            submitreleaseForm(formName) {
                //提交资源释放
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        var rows = this.multseleSelection;
                        if(rows.length <1){
                            this.$message({
                                message: '请选择释放资源',
                                type: 'warning'
                            });
                            return;
                        }
                        var  releId=[];
                        if(null!=rows&&rows.length>0){
                            for(var i=0;i<rows.length;i++){
                                releId.push(rows[i].clueId);
                            }
                        }
                        var  reason= this.releaseForm.reason;
                        var  param={};
                        param.releaseClueId=releId;
                        param.releaReason=reason;
                        this.releaseFormVisible=false;
                        axios.post('/tele/clueMyCustomerInfo/releaseClue', param)
                            .then(function (response) {
                                mycustomVM.$message({message:'操作成功',type:'success',duration:2000,onClose:function(){
                                        mycustomVM.initTableData();
                                    }});
                            }).catch(function (error) {
                        });
                    } else {
                        return false;
                    }
                });
            },
            recordClick(row) {
                this.recordDialog=true;
            },
            repeatPhonesClick(row) {
                this.repeatPhonesDialog=true;
                this.dailogTitleType=row.clueId;
                this.repeatPhonesTable=[];
                var param ={};
                param.id = row.clueId;
                param.cusPhone = row.phone;
                param.clueId = row.clueId;
                // axios.post('/clue/appiontment/repeatPhonelist', param)
                axios.post('/clue/appiontment/repeatPhoneMap', param).then(function (response) {
                    // var result =  response.data;
                    // var table=result.data;
                    // mycustomVM.repeatPhonesTable=table;
                    var map = response.data.data;
                    if(map.phone){
                        mycustomVM.phone = map.phones[0]
                        mycustomVM.repeatPhonesTable=map.phone;
                        mycustomVM.showPhoneTable = true;
                    }else{
                        mycustomVM.phone = '';
                        mycustomVM.repeatPhonesTable=[];
                        mycustomVM.showPhoneTable = false;
                    }
                    if(map.phone2){
                        mycustomVM.phone2 = map.phones[1]
                        mycustomVM.repeatPhonesTable2=map.phone2;
                        mycustomVM.showPhoneTable2 = true;
                    }else{
                        mycustomVM.phone2 ='';
                        mycustomVM.repeatPhonesTable2=[];
                        mycustomVM.showPhoneTable2 = false;
                    }
                    if(map.phone3){
                        mycustomVM.phone3 = map.phones[2]
                        mycustomVM.repeatPhonesTable3=map.phone3;
                        mycustomVM.showPhoneTable3 = true;
                    }else{
                        mycustomVM.phone3 = '';
                        mycustomVM.repeatPhonesTable3=[];
                        mycustomVM.showPhoneTable3 = false;
                    }
                debugger
                    if(map.phone4){
                        mycustomVM.phone4 = map.phones[3]
                        mycustomVM.repeatPhonesTable4=map.phone4;
                        mycustomVM.showPhoneTable4 = true;
                    }else{
                        mycustomVM.phone4 = ''
                        mycustomVM.repeatPhonesTable4=[];
                        mycustomVM.showPhoneTable4 = false;
                    }
                    if(map.phone5){
                        mycustomVM.phone5 = map.phones[4]
                        mycustomVM.repeatPhonesTable5=map.phone5;
                        mycustomVM.showPhoneTable5 = true;
                    }else{
                        mycustomVM.phone5 = map.phones[4]
                        mycustomVM.repeatPhonesTable5=[];
                        mycustomVM.showPhoneTable5 = false;
                    }
                    mycustomVM.repeatPhonesDialog=true;
                })  .catch(function (error) {
                    console.log(error);
                });
            },
            repeatApplyNumber(){//输入手机号才显示查询资源按钮
                this.repeatApplyForm.phone=this.repeatApplyForm.phone.replace(/[^\.\d]/g,'');
                this.repeatApplyForm.phone=this.repeatApplyForm.phone.replace('.','');
                // if(this.repeatApplyForm.phone.length>10&&this.repeatApplyForm.phone.length<16){
                //     this.searchClueDisable=false;
                // }else{
                //     this.searchClueDisable=true;
                // }
            },
            repeatApplyRepeatNumber(){
                this.repeatApplyForm.repeatPhone=this.repeatApplyForm.repeatPhone.replace(/[^\.\d]/g,'');
                this.repeatApplyForm.repeatPhone=this.repeatApplyForm.repeatPhone.replace('.','');
                // if(this.repeatApplyForm.repeatPhone.length>10&&this.repeatApplyForm.repeatPhone.length<16){
                //     this.searchRepeatClueDisable=false;
                // }else{
                //     this.searchRepeatClueDisable=true;
                // }
            },
            //外呼号码
            async outboundCall(outboundInputPhone,clueId){//外呼
                var isReturn =false;
                await axios.post('/call/callRecord/missedCalPhone?phone='+outboundInputPhone, {})
                    .then(function (response) {
                        if(response.data !=""){
                            mycustomVM.$message({
                                message: response.data,
                                type: 'warning'
                            });
                            isReturn = true; ;
                        }
                        ;
                    });
                if(isReturn){
                    return;
                }
                var  param={};
                param.clueId=clueId;
                window.parent.outboundCallPhone(outboundInputPhone,2,clueId, function(res){
                    axios.post('/tele/clueMyCustomerInfo/updateCallTime',param).then(function(response){
                    });
                });
            },
            confirmColumn(){
                this.dialogChooseList = false;
                //处理用户选择的列
                if(this.fieldFrom.type.length==0){
                    this.$message({
                        message: "请至少保留一列",
                        type: 'error'
                    });
                    return;
                }
                var customerShowColun = [];
                var customerColumn = this.fieldFrom.type;
                customerColumn.sort(this.sortNumber);//对选择的列排序
                var idList=[];
                for(var i=0;i<customerColumn.length;i++){
                    var curItem = customerColumn[i];
                    var itemArr = curItem.split("_");
                    var obj = {};
                    obj.fieldCode=itemArr[1];
                    obj.displayName=itemArr[2];
                    obj.width=itemArr[4];
                    customerShowColun.push(obj);
                    idList.push(itemArr[3])
                }
                this.tableColums = customerShowColun;
                var param ={};
                param.fieldIdList = idList;
                param.menuCode = "myCustomerInfo";
                if(idList.length!=0){
                    axios.post('/customfield/customField/saveUserField', param)
                        .then(function (response) {

                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                }
            },
            initColumn(){
                //初始化table 列 和 用户自定义列
                this.allTableColums = fieldList;
                if(userFieldList.length!=0){
                    var type=[];
                    for(var i=0;i<userFieldList.length;i++){
                        type.push(userFieldList[i].sortNum+'_'+userFieldList[i].fieldCode+'_'+userFieldList[i].displayName+'_'+userFieldList[i].fieldId+'_'+userFieldList[i].width)
                    }
                    this.fieldFrom.type = type;
                    this.confirmColumn();
                }else{
                    var type=[];
                    for(var i=0;i<fieldList.length;i++){
                        type.push(fieldList[i].sortNum+'_'+fieldList[i].fieldCode+'_'+fieldList[i].displayName+'_'+fieldList[i].id+'_'+fieldList[i].width)
                    }
                    this.fieldFrom.type = type;
                    this.confirmColumn();
                }

            },
            sortNumber(a,b) {
                //对数组中元素，按照数字 从小到大 排序
                return a.split("_")[0] - b.split("_")[0];
            },
            setSessionStore (name, content) {
                if (!name) return
                if (typeof content !== 'string') {
                    content = JSON.stringify(content)
                }
                window.sessionStorage.setItem(name, content)
            },
            getSessionStore (name) {
                if (!name) return;
                var content = window.sessionStorage.getItem(name);
                if (typeof content == 'string') {
                    content = JSON.parse(content)
                }
                return content;
            },
            removeSessionStore (name) {
                if (!name) return
                return window.sessionStorage.removeItem(name)
            },

            showHasRepeatClue(row){
                var param ={};
                param.clueId = row.clueId;
                this.repeatClueList=[];
                axios.post('/tele/clueMyCustomerInfo/getRepeatClueRecordDTOList', param).then(function (response) {
                    mycustomVM.repeatClueList = response.data.data;
                    mycustomVM.dialogFormVisible1 =true;
                })

            },
            formatTimeFn(date) {
                if (null == date) {
                    return "";
                }
                var dateNew = new Date(date);
                var year = dateNew.getFullYear()
                var month = dateNew.getMonth() + 1
                var day = dateNew.getDate()
                var hour = dateNew.getHours()
                var minute = dateNew.getMinutes()
                var second = dateNew.getSeconds()
                return year + "-" + this.formatNumberFn(month) + "-" + this.formatNumberFn(day) + " " + this.formatNumberFn(hour) + ":" + this.formatNumberFn(minute) + ":" + this.formatNumberFn(second);
            },
            formatNumberFn(n) {
                n = n.toString()
                return n[1] ? n : '0' + n
            },
            getPhones(cus){
                var phones = '';
                phones = cus.phone;
                if(cus.phone2 != null && cus.phone2 != ''){
                    if(phones != ''){
                        phones = phones +","+cus.phone2;
                    }else {
                        phones = cus.phone2;
                    }
                }
                if(cus.phone3 != null && cus.phone3 != ''){
                    if(phones != ''){
                        phones = phones +","+cus.phone3;
                    }else {
                        phones = cus.phone3;
                    }
                }
                if(cus.phone4 != null && cus.phone4 != ''){
                    if(phones != ''){
                        phones = phones +","+cus.phone4;
                    }else {
                        phones = cus.phone4;
                    }
                }
                if(cus.phone4 != null && cus.phone5 != ''){
                    if(phones != ''){
                        phones = phones +","+cus.phone5;
                    }else {
                        phones = cus.phone5;
                    }
                }
                return phones;
            },
            lookWechat(val){
                mycustomVM.repeatCustomer = {};
                mycustomVM.repeatWechatVisible =true;
                mycustomVM.repeatCustomer = val;
            },
            telemarketingLayoutProjectIsShow(category){
                if((telemarketingLayout &&  (','+telemarketingLayout.category+',').indexOf(','+category+',') != -1 && telemarketingLayout.projectShow ==1) || roleCode =="GLY"){
                    return true;
                }
                return false;
            },
            telemarketingLayoutSourceIsShow(category){
                if((telemarketingLayout &&  (','+telemarketingLayout.category+',').indexOf(','+category+',') != -1 && telemarketingLayout.sourceShow ==1) || roleCode =="GLY"){
                    return true;
                }
                return false;
            },
        },
        mounted(){
            document.getElementById('myCustom').style.display = 'block';
            // 初始化释放原因
            param={};
            param.groupCode="releaseReason";
            axios.post('/dictionary/DictionaryItem/dicItemsByGroupCode',param).then(function (response) {
                mycustomVM.reasonArr=response.data.data;
            });

            // 初始化电销人员
            param={};
            param.groupCode="releaseReason";
            axios.post('/tele/clueMyCustomerInfo/listByOrgAndRole').then(function (response) {
                mycustomVM.telePerArr=response.data.data;
            });

        },
        created(){
            // 判断3不显示新建按钮
            if(businessLine){
                if(businessLine==3){
                    this.isShowCreate=false;
                }                
            }
            // window.sessionStorage.clear(); // 点击侧边栏-清除所有cookie

            //是否已签约 -默认查未签约的
            this.form.isSign = 0;

            //客户状态
            var param={};
            param.groupCode="customerStatus";
            axios.post('/dictionary/DictionaryItem/dicItemsByGroupCode',param).then(function (response) {
                var datas = response.data.data;
                var arr = []
                for(var i = 0 ; i < datas.length ; i++){
                    if(datas[i].name!='不跟进'){
                        arr.push(datas[i])
                    }

                }
                mycustomVM.cusStatusArr=arr
            });
            param={};
            param.groupCode="customerLevel";
            axios.post('/dictionary/DictionaryItem/dicItemsByGroupCode',param).then(function (response) {
                mycustomVM.cusLevelArr=response.data.data;
            });
            //初始资源类别数据
            param={};
            param.groupCode="clueCategory";
            axios.post('/dictionary/DictionaryItem/dicItemsByGroupCode',param).then(function (response) {
                mycustomVM.categoryArr=response.data.data;
            });
            param={};
            param.type="0";
            axios.post('/area/sysregion/querySysRegionByParam',param).then(function (response) {
                mycustomVM.provinceArr=response.data.data.data;
            });

            // 初始化列
            this.initColumn();
            // 获取url地址
            // debugger
            //  1:未签约  isSign = 0
            // 2今日新增  distributionTimeStart=  distributionTimeEnd=
            // 3自建客户  teleReceiveSource = 4
            // 4已签约客户 isSign = 1
            // 5今日领取 teleReceiveSource = 1
            var type=getQueryString("type");
            var hJtype=getQueryString("hJtype");
            console.log(type)
            if(type){
                // 隐藏慧聚tab
                this.isElBreadcrumb=false;
                if(type==1){
                    this.form.isSign=0;
                    this.dataUrlParam.dataUrlArr[0].isActive=true;
                    this.disabledIsSign=true;
                }else if(type==2){
                    this.form.distributionTimeStart=new Date(new Date(new Date().toLocaleDateString()).getTime());//当前日期零点开始
                    this.form.distributionTimeEnd=new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60*1000-1);//当前日期23点结束
                    this.dataUrlParam.dataUrlArr[1].isActive=true;
                    this.disabledCreateTime=true;
                }else if(type==3){
                    this.form.teleReceiveSource="4";
                    this.dataUrlParam.dataUrlArr[4].isActive=true;
                    this.disabledTeleReceiveSource=true;
                }else if(type==4){
                    this.form.isSign=1;
                    this.dataUrlParam.dataUrlArr[7].isActive=true;
                    this.disabledIsSign=true;
                }else if(type==5){
                    this.form.teleReceiveSource="3";
                    this.dataUrlParam.dataUrlArr[3].isActive=true;
                    this.disabledTeleReceiveSource=true;
                }
            }else if(hJtype){
                // 显示慧聚tab
                this.isElBreadcrumb=true;
                if(hJtype==1){ //未签约客户
                    this.form.isSign=0;
                    this.dataUrlParamHJ.dataUrlArr[0].isActive=true;
                    this.disabledIsSign=true;
                }else if(hJtype==2){ //今日新增
                    this.form.distributionTimeStart=new Date(new Date(new Date().toLocaleDateString()).getTime());//当前日期零点开始
                    this.form.distributionTimeEnd=new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60*1000-1);//当前日期23点结束
                    this.dataUrlParamHJ.dataUrlArr[1].isActive=true;
                    this.disabledCreateTime=true;
                }else if(hJtype==3){ //vip
                    this.dataUrlParamHJ.dataUrlArr[3].isActive=true;
                    this.form.cusLevelList.push("1");
                    this.disabledCusLevelList=true;
                    this.disabledIsSign=true;
                }else if(hJtype==4){ //重要客户
                    this.dataUrlParamHJ.dataUrlArr[4].isActive=true;
                    this.form.cusLevelList.push("2");
                    this.disabledCusLevelList=true;
                    this.disabledIsSign=true;
                }else if(hJtype==5){ //今日领取
                    /* 今日领取加入 */
                    this.form.distributionTimeStart=new Date(new Date(new Date().toLocaleDateString()).getTime());//当前日期零点开始
                    this.form.distributionTimeEnd=new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60*1000-1);//当前日期23点结束
                    this.disabledCreateTime=true;

                    this.form.teleReceiveSource="3";
                    this.dataUrlParamHJ.dataUrlArr[5].isActive=true;
                    this.disabledTeleReceiveSource=true;
                }else if(hJtype==6){ //自建客户
                    this.form.teleReceiveSource="4";
                    this.dataUrlParamHJ.dataUrlArr[6].isActive=true;
                    this.disabledTeleReceiveSource=true;
                }else if(hJtype==7){ //已签约
                    this.form.isSign=1;
                    this.dataUrlParamHJ.dataUrlArr[7].isActive=true;
                    this.disabledIsSign=true;
                }
                // 默认选中当天了，只有今日新增默认选中当天
                // this.form.distributionTimeStart=new Date(new Date(new Date().toLocaleDateString()).getTime());//当前日期零点开始
                // this.form.distributionTimeEnd=new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60*1000-1);//当前日期23点结束

                // 进入页面判断有是否有存储值
                if(!this.paginationShow){
                    var storeVal = this.getSessionStore("storeForm");
                    var otherVal = this.getSessionStore("otherVal");
                    if(storeVal && otherVal){
                        this.form = storeVal;
                        this.$set(this.pager,"currentPage",otherVal.currentPage);
                        this.storeId = otherVal.clueId;
                        this.scrollTop = otherVal.scrollTop;
                    }
                    // 取页数存储
                    var localVal=localStorage.getItem('allChangePageSize')?parseInt(localStorage.getItem('allChangePageSize')):'';
                    if(localVal){this.pager.pageSize = localVal;}
                }
            }
            //初始化数据列表
            this.initTableData();
        }
    })

    function locationPost(url, params) {
        document.write("<form action="+url+" method=post name=form1 style='display:none'>");
        for (let x in params) {
            document.write("<input type=hidden name="+x+" value='"+params[x]+"'></input>");
        }
        document.write("</form>");
        document.form1.submit();
    }
</script>


</html>